package me.ywd.feign.controller;

import me.ywd.feign.client.EurekaClient;
import me.ywd.feign.client.ProviderClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by ywd-pc on 2017/9/20.
 */
@RestController
@RequestMapping("feign")
public class FeignController {
    @Autowired
    private EurekaClient eurekaClient;

    @Autowired
    private ProviderClient providerClient;

    @GetMapping
    public String test() {
        return "test";
    }

    @GetMapping("client")
    public String client() {
        return eurekaClient.demo();
    }

    @GetMapping("provider")
    public String provider() {
        return providerClient.demo();
    }
}
